<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script>
      function ob(){
        let l =document.getElementById("sp");
        l.innerText="文本框失去焦点";
      }
      function onf() {
        let t = document.getElementById("sp");
        t.innerText="文本框获得焦点"
      }
      function change() {
          alert("输入框内容发生了变化");
      }
     </script>
</head>
<body align="center">
  <input type="text" onblur="ob()" onfocus="onf()" onchange="change()"/><br/>
  <span id="sp"></span>
</body>
</html>